package Package.List2;

import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;

public class List2 {
    public static final void List2(){
        LinkedList<String> list = new LinkedList<String>();
        list.add("Hello");
        list.add("World");
        list.add("java");
        System.out.println(list);
        list.addFirst("javaee");
        list.addLast("spring");
        System.out.println(list);
        System.out.println(list.getFirst());
        System.out.println(list.getLast());
        list.removeLast();
        System.out.println(list);
        list.removeFirst();
        System.out.println(list);
    }
}
